<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--        <p>2123</p>-->

<!--<button>获取时间</button>-->

<div class="base infoinput" >
    用户名
    <input name="userName" id="userName">
</div>
<div class="base infoinput">
    密码
    <input name="passWord" id="passWord">
</div>
<button id="loginButton"> 登录</button>
<button id="resginButton"> 注册</button>



</body>
    <script src="https://cdn.staticfile.net/jquery/1.10.2/jquery.min.js">
    </script>
<script>
    var text;
    // $("#time").click(function () {
    //     $.ajax({
    //         url: "/time",
    //         success: function (result) {
    //             alert("获取到的时间为"+result)
    //         }
    //     });
    // });
    $("#loginButton").click(function () {
       var userName= $("#userName").val()
        var passWord= $("#passWord").val()
        console.log(userName,passWord)
        $.ajax({
            url:"/login",
            data:{
                userName:userName,
                passWord:passWord
            },
            success:function (result){
                alert(result)
            }
        })
    });


    $("#resginButton").click(function () {
        var userName= $("#userName").val()
        var passWord= $("#passWord").val()
        console.log(userName,passWord)
        $.ajax({
            url:"/resgin",
            data:{
                userName:userName,
                passWord:passWord
            },
            success:function (result){
                alert(result)
            }
        })
    });

</script>
</html>